package com.cap.dreamcircle.View.Adapter.Item;

import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cap.dreamcircle.Common.RecyclerView.BaseItem;
import com.cap.dreamcircle.Model.Bean.GridCalenderDateEntity;
import com.cap.dreamcircle.R;
import com.cap.dreamcircle.Utils.DisplayUtil;

/**
 * Created by liucxu on 2017/9/1.
 */

public class CalendarGridItem extends BaseItem<GridCalenderDateEntity> {

    private RelativeLayout layout_calendar;
    private TextView tv_calendar_date;

    public CalendarGridItem(ViewGroup parent) {
        super(parent);
    }

    @Override
    public int getRes() {
        return R.layout.adapter_grid_calendar;
    }

    @Override
    public void onCreateView(View rootView) {
        layout_calendar=(RelativeLayout)rootView.findViewById(R.id.layout_calendar);
        tv_calendar_date=(TextView)rootView.findViewById(R.id.tv_calendar_date);
        ViewGroup.LayoutParams para;
        para = layout_calendar.getLayoutParams();
        para.height = DisplayUtil.GetDisplayWidth()/7;
        para.width = DisplayUtil.GetDisplayWidth()/7;
        layout_calendar.setLayoutParams(para);
    }

    @Override
    public void onBindView(GridCalenderDateEntity gridCalenderDateEntity) {
        tv_calendar_date.setText(gridCalenderDateEntity.getMonth()+"");
    }
}
